<!DOCTYPE html>
<html lang="en">
<head>
    <title>佳怡供应链金融</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
    <link rel="stylesheet" href="lib/weui.min.css">
    <link rel="stylesheet" href="css/jquery-weui.css">
    <link rel="stylesheet" href="demos/css/demos.css">
    <link rel="stylesheet" href="font/fontscss/iconfont.css">
    <link rel="stylesheet" href="css/common.css">
    <script src="lib/jquery-2.1.4.js"></script>
    <script src="js/select2.js"></script>
    <script src="js/select2_locale_zh-CN.js"></script>
    <link rel="stylesheet" href="js/select2.css">

    <style type="text/css">
        .content-header {
            width: 100%;
            background-color: #FF9461;
            position: relative;
            z-index: 10;
            color: #fff;
        }

        #pro_name {
            font-size: 16px;
            padding-top: 0.7rem;
            padding-left: 15%;
        }

        #one_pri {
            font-size: 32px;
        }

        .ljsy {
            pont-size: 12px;
            opacity: 0.6;
        }

        .tzze {
            padding-top: 1.5rem;
            font-size: 16px;
        }

        .time {
            text-align: center;
        }

        .time-left {
            width: 50%;
            display: inline-block;
            line-height: 1.5rem;
        }

        .span1 {
            font-size: 14px;
        }

        .span2 {
            font-size: 12px;
            opacity: 0.6;
        }

        .time-left span {
            display: block;
        }

        .time-right {
            width: 48%;
            float: left;
            line-height: 1.5rem;
        }

        .time-right span {
            display: block;
        }

        .content-info ul li {
            height: 3rem;
            line-height: 3rem;
            border-bottom: 1px solid #E6E2E2;
            font-size: 16px;
        }

        .content-info ul li span {
            color: #FF9461
        }

        .content-info .content-orl {
            width: 10%;
            display: inline-block;
        }

        .content-info .content-title {
            width: 59%;
            display: inline-block;
        }

        .content-info .content-info {
            width: 18%;
            display: inline-block;
        }

        .content-info .content-orl {
            background-image: url("demos/images/rol.png");
        }
        .comment{
            border: 1px solid #ABA1A1;
            border-radius: 1rem;
            width: 64%;
            position: relative;
            left: 5rem;
            margin-top: 1rem;
            margin-bottom: 1rem;
        }
        .tbtop{
            padding-left: 1rem;
            color:#FF9461;
        }
        .tbtop span{
            display: block;
        }
        .pz{
            margin-left: 1rem;
        }
        .icon_back{
            position: absolute;
            left: -1rem;
            top: 0.9rem;
            width: 0.5rem;
            height: 1.0rem;
            background: url(./images/icon-back.png);
            background-size: 0.5rem 1em;
            vertical-align: middle;
        }
        .weui-cell__ft{
            width: 65%;
        }
        .weui-cell__bd{
            width: 35%;
        }
    </style>

    <script type='text/javascript' src='js/swiper.js' charset='utf-8'></script>
</head>

<body>
<header>
    <div class="weui-row weui-no-gutter">
        <div class="weui-col-33" id="back_icon">
            <a href="javascript:history.go(-1)" class="icon pull-right"><i class="icon_back"></i></a>
        </div>
        <div class="weui-col-33">申请详细</div>
        <div class="weui-col-33" id="ligin_icon">
            <!-- <a href="login.html" class="icon pull-right"><i class="iconfont icon-wode"></i></a> -->
        </div>
    </div>
</header>
<div class="weui-cells">


    <!-- <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>项目名称</p>
         </div>
         <div class="weui-cell__ft">
             12312321
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>合同编号</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>审批状态</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>申请日期</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>资金使用起始时间</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>资金使用结束时间</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>使用部门</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>使用部门</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>使用中心</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>使用项目部</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>申请人</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>申请金额</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>综合融资成本率</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>融资用途</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>预计还款时间1</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>预计还款金额1</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>预计还款时间2</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>预计还款金额2</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>乙方开户行</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>乙方账户名</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>
     <div class="weui-cell">
         <div class="weui-cell__bd">
             <p>乙方账号</p>
         </div>
         <div class="weui-cell__ft">
         </div>
     </div>-->
</div>

</body>
<script src="js/circleProgress.js"></script>
<script src="js/jquery-weui.js"></script>
<script src="js/reg.js"></script>
<script type="text/javascript">
    $(function () {
        var str = "";
        var id = localStorage.getItem("sq_id");
        var proId = localStorage.getItem("sq_proId");
        $.ajax({
            type: "POST",
            url: "ccc/getsingCreditApplyInfo",
            data: {id: id},   //传递输入框中的值
            success: function (val) {
                var msg=val.mm;

                console.log(msg);
                str+="<div class=\"weui-cell\">"
                str+="<div style='margin-left: 5%'> <a href=\"javascript:;\"onclick='goGuiJi(id)' class=\"weui-btn weui-btn_primary\">审核轨迹查询</a></div>"
                str+="<div style='margin-left: 2%;float: left'> <a href=\"javascript:;\"onclick=\"chexiao('"+msg.iscx+"')\" class=\"weui-btn weui-btn_primary\">撤销</a></div>"
                str+="<div style='margin-left: 2%;float: left'> <a href=\"javascript:;\"onclick=\"tijiao('"+msg.types+"','"+msg.apply_time+"','"+msg.audit_state+"')\" class=\"weui-btn weui-btn_primary\">提交申请</a></div>"

                str+="</div>"
                str+="<div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>项目名称</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.project_namegd2+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>合同编号</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.bh+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>审批状态</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.auditState+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>申请日期</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.apply_time+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>资金使用起始时间</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.start_time+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>资金使用结束时间</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.end_time+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>使用部门</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.deptname+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>使用中心</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    isNull(msg.centername)+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>使用项目部</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    isNull(msg.projectDeptname)+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>申请人</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.username+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>申请金额</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.apply_money+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>综合融资成本率</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.rate*100+"%"+
                    "        </div>"+
                    "    </div>"+
                   /* "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>综合融资成本</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.finance_cost+
                    "        </div>"+
                    "    </div>"+*/
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>融资用途</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.purpose+
                    "        </div>"+
                    "    </div>";
                  /*  "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>还款时间</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.yjrepayment_time1+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>还款金额</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.yjrepayment_money1+
                    "        </div>"+
                    "    </div>"+*/
                        /*   "    <div class=\"weui-cell\">"+
                         "        <div class=\"weui-cell__bd\">"+
                         "            <p>预计还款时间2</p>"+
                         "        </div>"+
                         "        <div class=\"weui-cell__ft\">"+
                         msg.yjrepayment_time2+
                         "        </div>"+
                         "    </div>"+
                         "    <div class=\"weui-cell\">"+
                         "        <div class=\"weui-cell__bd\">"+
                         "            <p>预计还款金额2</p>"+
                         "        </div>"+
                         "        <div class=\"weui-cell__ft\">"+
                         msg.yjrepayment_money2+
                         "        </div>"+
                         "    </div>"+*/
                  /*  "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>乙方开户行</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.yopen_bank+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>乙方账户名</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.yaccount_name+
                    "        </div>"+
                    "    </div>"+
                    "    <div class=\"weui-cell\">"+
                    "        <div class=\"weui-cell__bd\">"+
                    "            <p>乙方账号</p>"+
                    "        </div>"+
                    "        <div class=\"weui-cell__ft\">"+
                    msg.yaccount_number+
                    "        </div>"+
                    "    </div>";*/
                $(".weui-cells").append(str);

                var imgs="";
                var imgs2 = new Array()
                // imgs+="<div>"
                imgs+= "  <div class=\"weui-cell\">"
                imgs+="<div class=\"pz\">图片:"
                imgs+= "<div class=\"tbtop\">"


                $.each(val.mfList,function (x,y) {
                    imgs+="  <img style='width: 30%;height:30%;float: 'id='"+x+"' class='img' src='rzRelease/getimgurlcp?iurl="+y.filename+"'>"
                    imgs2[x]='rzRelease/getimgurlcp?iurl='+y.filename+''

                    // imgs+="    <div class=\"tbtop\" style='margin:auto; overflow:visible;text-align:center;'>"
                    // imgs+=" <img style='width: 30%;height:30%;float: ' src='rzRelease/getimgurlcp?iurl="+y.filename+"'></img> "
                    //imgs+="</div>"
                })

                console.info(imgs2)
                imgs+="</div>";
                imgs+="</div>";
                imgs+="</div>";
                $(".weui-cells").append(imgs);
                var pb1 = $.photoBrowser({
                    items: imgs2
                });

                $(".img").on("click",function(){
                    pb1.open(this.id)
                })
                var commons="";
                commons+="<div>"
                commons+="<div class=\"pz\">批注：</div>"
                $.each(val.list,function (x,y) {

                    commons+="<div class=\"comment\">"
                    commons+="    <div class=\"tbtop\">"
                    commons+="   <span>批注人："+y.realname+"</span>"
                    commons+="<span>批注部门："+y.department_name+"</span>"
                    commons+=" <span>批注:"+y.message_+"</span>"
                    commons+="<span>批注时间："+y.time_+"</span>"
                    commons+="</div>"
                    commons+=" </div>"
                })
                commons+="</div>";
                $(".weui-cells").append(commons);
            }
        });
    });
    function isNull(str) {
        if (str == null || str == "" || str == "undefined") {
            return '';
        } else {
            return str;
        }
    }
    function goGuiJi(id){
        window.location.href="xfguiji.html";
    }
    function chexiao(iscx){
        if(iscx==0){
            $.alert("确定撤销此流程", function() {
                $.ajax({
                    type: "POST",
                    url: "ccc/iscx",
                    data: {id: localStorage.getItem("sq_id"),process_id:localStorage.getItem("sq_proId"),realname: localStorage.getItem("realname"),userId:localStorage.getItem("token")},   //传递输入框中的值
                    success: function (val) {
                        $.toast("撤销成功");
                        location.href="myxfsq.html"
                    }
                })
            });
        }else{
            $.toast("无法撤销此流程")
        }
    }

    function tijiao(type,apply_time,audit_state){
        if(audit_state==0||audit_state==3) {
        $.modal({
            title: "Hello",
            text: "<span style='   margin-left: 25px;'>请选择上级审核人：</span><input type='text' style='height: 30px;width:250px;'id='dbUser'>",
            buttons: [
                {
                    text: "确定", onClick: function () {

                        if ($("#dbUser").val() != "" && $("#dbUser").val() != null) {

                            $.ajax({
                                type: "POST",
                                url: "ccc/applyTj",
                                data: {
                                    userId: localStorage.getItem("token"),
                                    id: localStorage.getItem("sq_id"),
                                    pocessId: localStorage.getItem("sq_proId"),
                                    dbUser: $("#dbUser").val(),
                                    dbname: $.trim($("#dbUser").select2("data").text),
                                    type: type,
                                    cl_time: apply_time
                                }, //传递输入框中的值
                                success: function (msg) {
                                    if (msg) {

                                        location.href = "myxfsq.html";
                                        $.toast("申请提交成功")
                                    }
                                }
                            })
                        } else {
                            $.toast("请填写上级审核人")
                        }
                    }
                }


            ]
        });

        }else{
            $.toast("此申请已提交")
        }

        $("#dbUser").select2({
            placeholder : "请选择上级处理人", //默认文本框显示信息
            minimumInputLength : 0, //最小输入字符长度
            multiple : false, //设置多项选择，false则只能单选
            allowClear : true,
            maximumSelectionSize : 5,
            query : function(query) {
                $.ajax({
                    type : "POST",
                    url: "rzRelease/getUsers",
                    data : {
                        name : query.term
                    }, //传递输入框中的值
                    success : function(msg) {
                        var msg = $.parseJSON(msg);
                        var data = {
                            results : []
                        };
                        $.each(msg, function(x, y) {
                            data.results.push({
                                id : y.id,
                                text : y.name
                            });
                        });
                        query.callback(data);
                    }
                });
            }
        });
    }
</script>
<script src="js/web/checkLogin.js"></script>
</html>